package com.ruoyi.device.api.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 设备在线信息对象 device_online
 * 
 * @author luogongquan
 * @date 2024-09-06
 */
public class DeviceOnline extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 设备id */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long deviceId;

    /** 是否在线  （1：在线  0：离线） */
    @Excel(name = "是否在线  ", readConverterExp = "1=在线,0=离线")
    private String isOnline;

    /** 首次上线时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "首次上线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date firstOnlineTime;

    /** 最后离线时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "最后离线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastOfflineTime;

    /** 本次上线时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "本次上线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date onlineTime;

    /** 设备编号 */
    @Excel(name = "设备编号")
    private String deviceNo;

    public void setDeviceId(Long deviceId) 
    {
        this.deviceId = deviceId;
    }

    public Long getDeviceId() 
    {
        return deviceId;
    }
    public void setIsOnline(String isOnline) 
    {
        this.isOnline = isOnline;
    }

    public String getIsOnline() 
    {
        return isOnline;
    }
    public void setFirstOnlineTime(Date firstOnlineTime) 
    {
        this.firstOnlineTime = firstOnlineTime;
    }

    public Date getFirstOnlineTime() 
    {
        return firstOnlineTime;
    }
    public void setLastOfflineTime(Date lastOfflineTime) 
    {
        this.lastOfflineTime = lastOfflineTime;
    }

    public Date getLastOfflineTime() 
    {
        return lastOfflineTime;
    }
    public void setOnlineTime(Date onlineTime) 
    {
        this.onlineTime = onlineTime;
    }

    public Date getOnlineTime() 
    {
        return onlineTime;
    }
    public void setDeviceNo(String deviceNo) 
    {
        this.deviceNo = deviceNo;
    }

    public String getDeviceNo() 
    {
        return deviceNo;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("deviceId", getDeviceId())
            .append("isOnline", getIsOnline())
            .append("firstOnlineTime", getFirstOnlineTime())
            .append("lastOfflineTime", getLastOfflineTime())
            .append("onlineTime", getOnlineTime())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("deviceNo", getDeviceNo())
            .toString();
    }
}
